//
//  IdiomViewController.m
//  baodongPro
//
//  Created by feng on 16/3/15.
//  Copyright © 2016年 proper. All rights reserved.
//
#define MyIdiomCellsId  @"MyIdiomCellsId"
#define MyCellHeight  160.0
#import "IdiomViewController.h"
#import "IdiomExplainTableViewCell.h"
#import "UIView+FBDQuickCreateUI.h"

@interface IdiomViewController ()<UITableViewDataSource,UITableViewDelegate>
{
    UITableView* _myTableView;
    UISearchBar* _searchBar;
}
@end

@implementation IdiomViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=[UIColor whiteColor];
    
    _searchBar=[[UISearchBar alloc] initWithFrame:CGRectMake(0, NavTop,ScreenW ,30 )];
    _searchBar.backgroundColor=[UIColor clearColor];
    _searchBar.barTintColor=[UIColor whiteColor];
    _searchBar.placeholder=@"请输入你要查询的成语";
    [self.view addSubview:_searchBar];
    
    CGFloat orignY=CGRectGetMaxY(_searchBar.frame);//TabBarHeight
    _myTableView=[[UITableView alloc] initWithFrame:CGRectMake(0, orignY, ScreenW, ScreenH-orignY-49) style:UITableViewStylePlain];
    _myTableView.keyboardDismissMode=UIScrollViewKeyboardDismissModeOnDrag;
    _myTableView.rowHeight=MyCellHeight;
    _myTableView.delegate=self;
    _myTableView.dataSource=self;
    [self.view addSubview:_myTableView];
    

    
    
}
#pragma mark ---- UITabViewDelegate && UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return 6;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    IdiomExplainTableViewCell* cell=[tableView dequeueReusableCellWithIdentifier:MyIdiomCellsId];
    if (!cell) {
        cell=[[IdiomExplainTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdiomCellsId withFrame:CGRectMake(0, 0, ScreenW, MyCellHeight)];
    }
    
    
    
    
    
    return cell;
    

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
